package cn.dkk.behavior_design.command;

import java.util.Map;

/**
 * @author dkk
 * @date 2022/7/21
 * @desc 命令具体对象(订单命令)
 */
public class OrderCommand implements Command{

    private Consumer consumer;

    private Order order;

    @Override
    public void execute() {
        System.out.println(order.getTableNum()+"桌订单");
        for (Map.Entry<String, Integer> stringIntegerEntry : order.getHashMap().entrySet()) {
            consumer.execute(stringIntegerEntry.getKey(),stringIntegerEntry.getValue());
        }
        System.out.println("完成了");
    }

    public Consumer getConsumer() {
        return consumer;
    }

    public void setConsumer(Consumer consumer) {
        this.consumer = consumer;
    }

    public Order getOrder() {
        return order;
    }

    public void setOrder(Order order) {
        this.order = order;
    }
}
